﻿using System;
using System.Drawing;

namespace YRevitJig
{
	public class XArc2D : XDrawable2D, ICloneable
	{
		public XArc2D(System.Drawing.Point ptStart, Point ptEnd, Point ptOnArc)
		{
			this.PointStart = ptStart;
			this.PointEnd = ptEnd;
			this.PointOnArc = ptOnArc;
		}

		public override void Draw(XGraphics g)
		{
			try
			{
				RectangleF rect = default(RectangleF);
				double num = 0.0;
				double num2 = 0.0;
				Utility.GetGraphicsArcInfo(this.PointStart, this.PointEnd, this.PointOnArc, ref rect, ref num, ref num2);
				g.m_graphics.DrawArc(g.m_pen, rect, (float)num, (float)num2);
			}
			catch
			{
			}
		}

		public object Clone()
		{
			try
			{
				return new XArc2D(this.PointStart, this.PointEnd, this.PointOnArc);
			}
			catch
			{
			}
			return null;
		}

		public Point PointStart { get; set; }

		public Point PointEnd { get; set; }

		public Point PointOnArc { get; set; }

		public int Radius
		{
			get
			{
				return this.m_iRadius;
			}
		}

		private int m_iRadius = 0;
	}
}
